package com.atguigu.dw.gmall.realtime.app

import java.text.SimpleDateFormat
import java.util.Date

import com.alibaba.fastjson.JSON
import com.atguigu.constan.ConstanVal
import com.atguigu.dw.gmall.realtime.bean.StartupLog
import com.atguigu.dw.gmall.realtime.util.{MyKafkaUtil, RedisUtil}
import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.streaming.{Seconds, StreamingContext}
import org.apache.spark.streaming.dstream.DStream

/**
 * description ：app 类
 * author      ：剧情再美终是戏 
 * mail        : 13286520398@163.com
 * date        ：Created in 2020/2/14 15:26
 * modified By ：
 * version:    : 1.0
 */
trait App {


  def main(args: Array[String]): Unit = {

    // 创建 StreamContext
    val sparkConf = new SparkConf().setMaster("local[2]").setAppName(DauApp.getClass.getName)
    val ssc = new StreamingContext(sparkConf, Seconds(3))

    handle(ssc:StreamingContext)

    // 启动ssc,将阻止程序停止
    ssc.start()
    ssc.awaitTermination()
  }

  def handle(ssc:StreamingContext)
}
